const path = require('path');
// dirname: 后去一层....目录名
// basename: 取最后一层....path的最后一部分
let data = 'c:/app/view/html/demoOS.css';

console.log(path.basename(data));  // demoOS.css
console.log(path.dirname(data));   // c:/app/view/html

data = path.dirname(data);

console.log(data);

console.log(path.basename(data));
